/*
 * @(#)SecurityContextInfo.java
 *
 * Copyright 2012 by ShenY BIS, All rights reserved.
 */

package com.bis.framework.security.context;

import org.apache.struts2.ServletActionContext;

import com.bis.common.entity.SessionEntity;

/**
 * SecurityContextInfo
 * 
 * @author BIS 2012-12-24
 */
public class SecurityContextInfo
{
    /**
     * SESSION_CONTEXT_KEY
     */
    public final static String SESSION_CONTEXT_KEY = "userContext";

    /**
     * getSessionEntity
     * @Description:
     * @return
     */
    public static SessionEntity getSessionEntity()
    {
        return (SessionEntity) ServletActionContext.getRequest().getSession().getAttribute(SESSION_CONTEXT_KEY);
    }

    /**
     * setSessionEntity
     * @Description:
     * @param sessionEntity
     */
    public static void setSessionEntity(SessionEntity sessionEntity)
    {
        ServletActionContext.getRequest().getSession().setAttribute(SESSION_CONTEXT_KEY, sessionEntity);
    }

}
